{% extends 'datapanel/base.html' %}
{% load crispy_forms_tags %}
{% block content %}
<div id="content-main">
  <h3> 更新密码</h3><br>
  <form method="post" action="{% url 'datapanel:password_change' %}">
    {% csrf_token %}
    {% if form.errors %}
      <p class="errornote"> 输入错误，请按提示更正. </p>
    {% endif %}
    <fieldset class="module aligned wide">
    <div class="form-row">
      {{ form.old_password.errors }}
      {{ form.old_password.label_tag }} {{ form.old_password }}
    </div>
    <div class="form-row"> 
      {{ form.new_password1.errors }}
      {{ form.new_password1.label_tag }} {{ form.new_password1 }}
    </div>
    <div class="form-row">
      {% if form.new_password1.help_text %}
        <div class="help"{% if form.new_password1.id_for_label %} id="{{ form.new_password1.id_for_label }}_helptext"{% endif %}>{{ form.new_password1.help_text|safe }}</div>
      {% endif %}
    </div>
    <div class="form-row">
      {{ form.new_password2.errors }}
      {{ form.new_password2.label_tag }} {{ form.new_password2 }}
    </div>
    <div class="form-row">
      {% if form.new_password2.help_text %}
        <div class="help"{% if form.new_password2.id_for_label %} id="{{ form.new_password2.id_for_label }}_helptext"{% endif %}>{{ form.new_password2.help_text|safe }}</div>
      {% endif %}
    </div>

    </fieldset>
    <div class="submit-row">
      <input type="submit" value="确认" class="btn btn-success">
    </div>
  </form>
</div>

{% endblock %}